Week 2 Analysis
library(mosaic)
library(tidyverse)
library(plotly)
library(pander)
library(DT) # If you get an error stating:
# Error in library(DT): there is no package called 'DT'
# You will need to run: install.packages("DT")
# in your Console, then try "Knit HTML" again.
Rent <- read_csv("../Data/Rent.csv")
wRent <- Rent %>%
filter(Gender == 'F' & Price < 1000) %>%
mutate(
MilesToCampus = round(MilesToCampus, 2)
)
Stephanie1 is a student that will be starting school at BYU-Idaho next semester. Suppose she sent you the following email.
“Hi. My name is Stephanie. I would like to learn about what housing options I have for living at BYU-Idaho next semester. It will be my first semester there, so I would like to find something that is close to campus and around $300 a month in rent. I’m not too picky on roommates, but I would like somewhere that has a lot of people around so I can get to know as many people as possible. Thanks in advance!”
Write your response to Stephanie below. Use the “Rent” dataset, good statistical analysis, and clear writing to make some well supported suggestions to her about apartments that meet her stated criterions. You are free to use other criterion that you think she might find more meaningful as well.
Dear Stephanie,
I would love to help you in your housing search here at BYU-I! I’ll do my best to give you some of the best housing options based on what you have prioritized. One interesting thing about BYU-I housing is that all housing prices are based off of price per semester instead of a monthly rent fee. So, that puts your goal of about $300 dollars monthly to about $980 for the semester. With that in mind, I will limit all the apartments I show you to under $1000 to try and help you keep that goal.
You can use the arrows by each column name to sort the list according to the column of your choice. If you would like to see an apartment’s website, or read a short description of the apartment, click the green plus button to the left of the apartment name.
# Code to get you started, be sure to use a subset of Rent instead of Rent in this code though.
wRentTable <- wRent %>%
select(c(Apartment, Price, Capacity, MilesToCampus, Phone, Website, Description))
datatable(wRentTable, options=list(lengthMenu = c(5,10,30)), extensions="Responsive")
Now, lets try and hunt down the apartment that’s best for you. Because we are only looking at housing that works with your price range, we can focus on getting you the closest housing to campus with highest capacity(so you can have more people around to meet). The graph below compares these two attributes.
Note: The dot size is related to how much each apartment costs (the bigger the dot, the more pricey it gets). Feel free to hover over each option, see the names and prices of the apartments and get a feel for what price, capacity, and distance from campus sounds best for you.
plot_ly(wRent,
x= ~MilesToCampus,
y= ~Capacity,
color=~Price,
colors=c("hotpink","hotpink4"),
size= ~Price,
text= ~paste(Apartment, "\n$", Price)) %>%
layout(title= "Womens BYU-I Approved Housing\nUnder $1000 per Semester",
xaxis=list(title="Miles to the Center of Campus"),
yaxis=list(title="Maximum Housing Capacity"))
As you can see, most of the housing under $1000 have pretty low capacities, but thankfully, we still have some pretty good options. The apartments we are looking for are the dots that are the highest and farthest to the left (which makes them the ones with the highest capacities and closest to campus). With that in mind, there appear to be to clear winners…
Here are my personal recommendations:
Birch Plaza and Royal Crest have over a 300 tenant capacity, and are directly touching campus, making them great candidates to consider.
However, if you wish to save a little more and lower your budget, there are some pretty good other options that aren’t as big but would save you the money.
Aspen Village and the Brooklyn Apartments have about half the capacity and are about twice as far from campus, but you would save $70-$100 per semester living there.
Note: Prices may have changed since this data was pulled.
finalists <- wRent %>%
filter(Capacity > 100) %>%
select(c(Apartment, Price, Capacity, MilesToCampus, Phone, Website, Description))
datatable(finalists, options=list(lengthMenu = c(4)), extensions= 'Responsive')
Let me know what you end up picking! Happy Housing!
Note that Stephanie is a fictional character who is based on real experiences of many faculty and staff here at BYU-Idaho.↩︎